package com.eric.springboot.exception;

/**
 * 自定义用户异常
 *
 * @author eric
 * @date 2021.2.4
 */
public class BaseException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private Long code;

    private String message;

    public BaseException(String message) {
        this.message = message;
    }

    public BaseException(Long code, String message) {
        this.message = message;
        this.code = code;
    }

    public BaseException(String message, Throwable e) {
        super(message, e);
        this.message = message;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public Long getCode() {
        return code;
    }
}
